import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vant from 'vant'
import 'vant/lib/index.css'
import './assets/css/gobal.css'
import axios from 'axios'
// 导入字体样式
import './assets/font/iconfont.css'

// 导入头部组件
import Top from './components/Top.vue'
// 导入底部组件
import Bottom from './components/Bottom.vue'

// 导入懒加载插件
import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad)

// 将头部组件和底部组件 设置为全局组件
Vue.component('top', Top)
Vue.component('bottom', Bottom)

Vue.use(Vant)
axios.defaults.baseURL = 'http://www.liulongbin.top:3005'

Vue.prototype.axios = axios
Vue.config.productionTip = false

Vue.filter('dateFormat', function(time) {
  const date = new Date(time)
  const y = date.getFullYear()
  const m = date.getMonth() + 1
  const d = date.getDay()
  return y + '-' + m + '-' + d
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
